<template>
	<view>
		<uni-load-more status="loading" iconType="snow" v-if="list.length === 0 && !articleShow"></uni-load-more>
		<list-card v-for="item in list" :key="item.id" :cardData="item"></list-card>
		<view class="no-data" v-if="articleShow">没有文章</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				articleShow: false
			};
		},
		onLoad() {
			this.getMyArticle()
		},
		methods: {
			getMyArticle() {
				this.$api.get_myArticle().then(res => {
					this.list = res.data
					this.articleShow = this.list.length === 0 ? true : false
				})
			}
		}
	}
</script>

<style lang="scss">
	.no-data {
		padding: 50px;
		font-size: 14px;
		color: #999;
		text-align: center;
	}
</style>
